package com.seveneight.baijiesteward.ui.user.presenter;

import android.content.Context;

import com.seveneight.baijiesteward.bean.AnyBean;
import com.seveneight.baijiesteward.http.MyCallBack;
import com.seveneight.baijiesteward.ui.user.contract.EditCardContract;
import com.seveneight.baijiesteward.ui.user.model.EditCardModel;

import okhttp3.RequestBody;

/**
 * Created by user1 on 2018/3/22.
 */

public class EditCardPresenter implements EditCardContract.EditCardPresenter {

    EditCardContract.EditCardView editCardView;
    EditCardContract.EditCardModel editCardModel;

    public EditCardPresenter(EditCardContract.EditCardView editCardView) {
        this.editCardView = editCardView;
        editCardModel = new EditCardModel();
    }

    @Override
    public void editCard(Context context, RequestBody body) {
        editCardModel.editCard(context, body, new MyCallBack<AnyBean>() {
            @Override
            public void onSuccess(AnyBean anyBean) {
                editCardView.rebackEditStatus();
            }

            @Override
            public void onFailed() {

            }
        });
    }
}
